package picol.view.utility;

import java.util.Map;
import java.util.TreeMap;

/**
 *
 * @author Aurélien Marcel - Julien Sanderson
 */
public final class PCommand {
    //Action Command
    public static final String ACTION_RUN = "RunActionButton";
    public static final String ACTION_SAVE = "SaveActionButton";
    public static final String ACTION_OPEN = "OpenActionButton";
    public static final String ACTION_DEBUG = "DebugActionButton";
    public static final String ACTION_NEXT = "NextActionButton";
    public static final String ACTION_STOP = "StopActionButton";
    public static final String ACTION_NEW = "NewActionButton";
    public static final String ACTION_SAVEAS = "SaveAsActionButton";
    //Ident
    public static final int IDENT_RUN = 1;
    public static final int IDENT_SAVE = 2;
    public static final int IDENT_OPEN = 3;
    public static final int IDENT_DEBUG = 4;
    public static final int IDENT_NEXT = 5;
    public static final int IDENT_STOP = 6;
    public static final int IDENT_NEW = 7;
    public static final int IDENT_SAVEAS = 8;
    private static Map<String, Integer> commandMap = new TreeMap<String, Integer>();

    static {
        commandMap.put(ACTION_RUN, IDENT_RUN);
        commandMap.put(ACTION_SAVE, IDENT_SAVE);
        commandMap.put(ACTION_OPEN, IDENT_OPEN);
        commandMap.put(ACTION_DEBUG, IDENT_DEBUG);
        commandMap.put(ACTION_NEXT, IDENT_NEXT);
        commandMap.put(ACTION_STOP, IDENT_STOP);
        commandMap.put(ACTION_NEW, IDENT_NEW);
        commandMap.put(ACTION_SAVEAS, IDENT_SAVEAS);
    }

    public static int getKey(String _action) {
        return commandMap.get(_action);
    }
}
